package com.itheima.consumer.feign;

import com.itheima.consumer.config.FeignLogConfig;
import com.itheima.consumer.feign.fallback.UserClientFallback;
import com.itheima.consumer.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "user-service"
        ,fallback = UserClientFallback.class
        ,configuration = FeignLogConfig.class)
public interface UserClient {
    @GetMapping("/user/{id}")
    String findById(@PathVariable("id")Long id);
    @PostMapping("/user")
    String add(@RequestBody User user);
}
